﻿var formLoaded = function (store, records) {
    if (records.length > 0) {
        BadgeForm.form.loadRecord(records[0]);
        BadgeCfgStore.loaded = false;
        BadgePic.setImageUrl(records[0].data.BadgeImage);
    } else {
        BadgeForm.form.reset();
        BadgeCfgStore.removeAll();
    }
    BadgeForm.el.unmask();
};

var successHandler = function (form, action) {
    window.parent.EditBadgeWnd.hide();
    window.parent.GridPanel1.store.reload();
};